package com.cy.interfacetest.entity;

import java.util.function.Predicate;

public class AppInfo {
    private String name;
    private String id;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public AppInfo(String name, String id) {
        this.name = name;
        this.id = id;
    }

   public static Predicate<AppInfo> notSelf = e->!e.getId().equals("com.cy.interfacetest");

    @Override
    public String toString() {
        return "AppInfo{" +
                "name='" + name + '\'' +
                ", id='" + id + '\'' +
                '}';
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof AppInfo)) return false;
        AppInfo appInfo = (AppInfo) o;

        return id.equals(appInfo.id) && name.equals(appInfo.name);
    }

    @Override
    public int hashCode() {
        int result = name.hashCode();
        result = 31 * result + id.hashCode();
        return result;
    }
}
